<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ include file="taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <t:header title="Edit Teacher"/>
    </head>
    <body>
        <div id="header">
            <div id="titleSection">
                <t:pageheader title="Edit User"/>
            </div>
        </div>
        <div id="contentPanel">
            <div id="pageContent">
                <div class="sectionTitle">Edit Teacher</div>
                <s:errors/>
                <s:form action="/Teacher.action">

                    <table class="leftRightForm">
                        <tr>
                            <th><s:label name="teacher.id">Teacher Id:</s:label></th>
                            <td>
                                ${actionBean.teacher.id}<s:hidden name="teacher.id"/>
                                <s:hidden name="page"/>
                                <s:hidden name="mode"/>
                            </td>
                            <td><s:errors field="teacher.id"/></td>
                        </tr>
                        <tr>
                            <th><s:label name="teacher.prefixId">Prefix:</s:label></th>
                            <td>
                                <s:select name="teacher.prefixId">
                                    <s:options-collection collection="${actionBean.prefixes}" value="id" label="prefix"/>
                                </s:select>
                            </td>
                            <td><s:errors field="teacher.prefixId"/></td>
                        </tr>
                        <tr>
                            <th><s:label name="teacher.lastName">Last Name:</s:label></th><td><s:text name="teacher.lastName" /></td><td><s:errors field="teacher.lastName"/></td>
                        </tr>
                        <tr>
                            <th><s:label name="teacher.gradeId">Grade:</s:label></th>
                            <td>
                                <s:select name="teacher.gradeId">
                                    <s:options-collection collection="${actionBean.grades}" value="id" label="grade"/>
                                </s:select>
                            </td>
                            <td><s:errors field="teacher.gradeId"/></td>
                        </tr>
                        <c:if test="${!empty actionBean.teacher.picBlob}">
                            <s:url var="url" beanclass="pkg.action.ImageActionBean">
                                <s:param name="teacher.id" value="${actionBean.teacher.id}"/>
                                <s:param name="image"/>
                            </s:url>

                            <tr>
                                <th>Current Picture:</th><td><img src="${url}" /> </td><td></td>
                            </tr>
                        </c:if>
                        <tr>
                            <th><s:label name="picture">New Picture:</s:label></th><td><s:file name="picture" /></td><td><s:errors field="picture"/></td>
                        </tr>
                        <tr>
                            <th><s:label name="teacher.active">Active:</s:label></th><td><s:checkbox name="teacher.active" /></td><td><s:errors field="teacher.active"/></td>
                        </tr>
                        <tr>
                            <th><s:label name="teacher.primary">Default Viewed:</s:label></th><td><s:checkbox name="teacher.primary" /></td><td><s:errors field="teacher.primary"/></td>
                        </tr>
                    </table>
                    <div class="buttons">
                        <s:submit value="Save" name="save"/>
                        <t:buttonLink value="Cancel" beanclass="pkg.action.TeacherActionBean">
                            <t:param name="page" value="${actionBean.page}"/>
                        </t:buttonLink>
                    </div>
                </s:form>
            </div>
        </div>
    </body>
</html>
